// ---------------------------------------------------------------------------------------------------------------------
//   Copyright (c) SRT Solutions 2009. All rights reserved.
// ---------------------------------------------------------------------------------------------------------------------

namespace SRTSolutions.Elevate
{
    using global::System;

    /// <summary>
    /// A set of methods for doing unfold calculations
    /// </summary>
    public static class UnfoldHelpers
    {
        /// <summary>
        /// Creates a new result for an unfold calculation.
        /// </summary>
        /// <typeparam name="T">The type of the state variable.</typeparam>
        /// <typeparam name="TResult">The type of the result.</typeparam>
        /// <param name="result">The result value.</param>
        /// <param name="state">The state value.</param>
        /// <returns>The option containing the result and state</returns>
        public static Option<
#if NET_3_5
            Tuple<TResult,T>
#else
            System.Tuple<TResult, T>
#endif
            > CreateResult<T, TResult>(TResult result, T state)
        {
            return Option.Some(
#if NET_3_5
                Tuple
#else
                System.Tuple
#endif
                .Create(result, state));
        }
    }
}
